<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>Document</title>
</head>
<body>
	

	<script>
		var obj={
			name:'zs',
			age:17
		}
		//存储数据
		 window.localStorage.setItem('mykeys',JSON.stringify(obj))
		// 获取数据
	  let str=	window.localStorage.getItem('mykeys')
	  console.log(str.age)
	  var obj2=JSON.parse(str)
	  console.log(obj2.age)


	  window.localStorage.removeItem('mykeys') //清空具体的某一条数据
	  window.localStorage.clear()//清空所有的数据
		
		
		</script>
</body>
</html>